package com.wyix.entity;


/**
 * @author wangdx
 * @date 2025/8/1
 * @description 商品类
 */
public class Product {
    private String name;
    private short stock; // 商品库存，使用 short 类型
    private int salesCount; // 商品销量，使用 int 类型
    double price; // 商品价格，使用 double 类型

    public Product(String name, short stock, int salesCount, double price) {
        this.name = name;
        this.stock = stock;
        this.salesCount = salesCount;
        this.price = price;
    }

    @Override
    public String toString() {
        return "Product{name='" + name + "', stock=" + stock + ", salesCount=" + salesCount + ", price=" + price + "}";
    }
}
